package com.xtpt.disaster.common.consts;

public enum DataTypeEnum implements BaseEnum{

    DATABASE(0,"DATABASE"),
    FILE(1,"FILE"),
    VIRTUAL(2,"VIRTUAL");

    private String name;
    private Integer value;

    private DataTypeEnum(Integer value,String name){
        this.name = name;
        this.value = value;
    }

    public static DataTypeEnum getObject(Integer value){
        for(DataTypeEnum dataTypeEnum: DataTypeEnum.values()) {
            if(dataTypeEnum.getValue().equals(value)){
                return dataTypeEnum;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

}
